#ifndef OPLANE_H
#define OPLANE_H

#include "entity.h"
#include "OgrePlane.h"

class OPlane : public OEntity
{
    Q_OBJECT

    Q_PROPERTY(float xNormalPos READ xNormalPos WRITE setXPos);
    Q_PROPERTY(float yNormalPos READ yNormalPos WRITE setYPos);
    Q_PROPERTY(float zNormalPos READ zNormalPos WRITE setZPos);

    Q_PROPERTY(float xUpPos READ xUpPos WRITE setXUpPos);
    Q_PROPERTY(float yUpPos READ yUpPos WRITE setYUpPos);
    Q_PROPERTY(float zUpPos READ zUpPos WRITE setZUpPos);

    Q_PROPERTY(float dist READ dist WRITE setDist);
    Q_PROPERTY(float width READ width WRITE setWidth);
    Q_PROPERTY(float height READ height WRITE setHeight);

public:
    explicit OPlane(QObject *parent = 0);


    ObjectType type() {
        return PLANE;
    }

    void setPlane(Ogre::Plane* p) {
        m_plane = p;
    }

    virtual QString model() const {
        return id();
    }

    // ---- positon

    float xNormalPos() const ;

    void setXPos(float pos);

    float yNormalPos() const;

    void setYPos(float pos);

    float zNormalPos() const ;

    void setZPos(float pos);

    float dist() const;

    void setDist(float d);

    // ---- measurements

    float height() const;

    void setHeight(float d);

    float width() const;

    void setWidth(float d);

    // ---- face normal

    float xUpPos() const ;

    void setXUpPos(float pos);

    float yUpPos() const;

    void setYUpPos(float pos);

    float zUpPos() const ;

    void setZUpPos(float pos);

protected:
    Ogre::Plane* m_plane;

    void updatePos();

    float m_xPos;
    float m_yPos;
    float m_zPos;

    float m_xUpPos;
    float m_yUpPos;
    float m_zUpPos;

    float m_dist;

    float m_width;
    float m_height;
};

#endif // OPLANE_H
